package com.shnu.work.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Arrays;

/**
 * @author Shinomiya Kaguya
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum HealthConditionEnum {
    /**
     * 健康
     */
    HEALTHY(0, "健康"),
    /**
     * 亚健康
     */
    SUB_HEALTHY(1, "亚健康"),
    /**
     * 不健康
     */
    UNHEALTHY(2, "不健康");

    private int key;

    private String value;

    public static HealthConditionEnum getEmByKey(Integer key) {
        return Arrays.stream(HealthConditionEnum.values()).filter(em -> key.equals(em.getKey())).findFirst().orElse(null);
    }
}
